/*
 * @Description: 发起者信息部分。入参第一个统一为baseInfo的store
 */
import globalMethods from '@/plugins/methods';

export default (useBaseInfo, printFrom) => {
    let printSender = '';
    const businessData = useBaseInfo.baseInfo.businessData;
    const { senderDepartmentName, senderPostName, name } = businessData.senderUser;
    
    if (printFrom === 'summary') {
        // printSender =
        //     $('#panleStart').html() +
        //     ' (${ctp:toHTML(ctp:getDepartment(summaryVO.startMemberDepartmentId).name)}' +
        //     ' ' +
        //     '${ctp:toHTML(summaryVO.startMemberPostName)}) ';
        const createData = businessData.summary.createDate;
        printSender = `${name} (${senderDepartmentName}-${senderPostName}) `;
        printSender += globalMethods.getDateString(createData);
    } else if (printFrom === 'newColl') {
        printSender = `${name} (${senderDepartmentName}-${senderPostName}) `;
        printSender += globalMethods.getDateString(Date.now());
    }
    return new PrintFragment(
        globalMethods.i18n('collaboration.newPrint.originatorInformation'),
        `<center><span style='font-size:12px;line-height:24px;'>
    ${printSender}</span></center>`
    );
};
